<?php
//------------------------
// 订单商品，商品视图
// platform_goods , platform_order_goods
//-------------------------
namespace app\common\model;

use think\Model;
use think\Db;

class OrderGoodsView extends Model{

	// 设置platform_order_goods为主表
	protected $table = 'platform_order_goods';

	//自定义初始化
    protected function initialize()
    {
        parent::initialize();
        //TODO:自定义的初始化,连表
        $this->join('platform_goods','platform_goods.id = platform_order_goods.goods_id','LEFT');

        $this->field('platform_goods.goods_name, platform_goods.goods_sn, platform_order_goods.quantity, platform_order_goods.spec_key_name');
    }

}